import { RMIBase } from "../../../../common/net/RMIBase";
import { ILoginPrxHelper } from "../../../../../Message/Login/ILoginPrxHelper";
import { SLoginInfoShow } from "../../../../../Message/Public/SLoginInfoShow";
import { RMISession } from "../../../../common/net/RMISession";
import { LoginMessageHandler } from "../../LoginMessageHandler";
//class LoginRMI

export class LoginRMI extends RMIBase {
  constructor() {
    
    super();this.loginProxy = new ILoginPrxHelper();
    if (LoginRMI._instance != null) {
      throw new Error("CreateRoleRMI 单例");
    }
    new SLoginInfoShow();
    return;
  }

  public set /* override */ rmiSession(arg1: RMISession) {
    arg1.session.messageHandler = new LoginMessageHandler();
    super.rmiSession = arg1;
    return;
  }

  protected /* override */ initProxy(): void {
    this.session.registerProxy(this.loginProxy);
    return;
  }

  public static get instance(): LoginRMI {
    if (LoginRMI._instance == null) {
      LoginRMI._instance = new LoginRMI();
    }
    return LoginRMI._instance;
  }

  public /* var */ loginProxy: ILoginPrxHelper;

  private static /* var */ _instance: LoginRMI;
}
